package com.motu.monstercity.module.common.utility;

import com.motu.vertx.module.utility.base.ServerConfig;

/**
 * 事件总线常量类
 */
public class EventBusConstant {

	//游戏服
	public static final String GAME_GM = "game.gm";//接受广播重载数据的接口

	public static final String GAME_CUSTOM_LOGIC = "game.custom_logic";// 游戏服执行自定义逻辑

	public static final String GAME_IAP = "game.iap";//接受充值回调处理成功，给玩家加钻

	public static final String GAME_LOGIC = "game.logic";

	public static final String GAME_INIT = "game.init";
	public static final String MOTUWEB_TASK = "motuweb.task";// motuweb发送到gameweb执行任务

	public static final String MONITOR_SAVEDATA = "monitor.savedata";
	public static final String MONITOR_SAVEDATA_PLAYERONLINE = "monitor.savedata_playeronline";

	public static final String GM_HANDLER = "gm.handler";

	//网关服
	public static final String GATE_BROADCAST = "gate.broadcast";

	public static final String GATE_CHECKREPEATEDLOGIN = "gate.checkrepeatedlogin";

	public static final String GATE_RECEIVE = "gate.receive";

	// 定时任务服
	public static final String TIME_MAIN = "time.main";// 定时任务主线程（单进程单线程，用于给定时队列静态缓存添加数据）
	public static final String TIME_WORK = "time.work";// 定时任务工作线程（多进程多线程，用于执行具体的定时任务逻辑）

	public static final String BACKUPS = "backups";// 备份进程后缀名称


	/**
	 * 获取事件总线地址
	 */
	public static String getAddress(String eventBusName) {
		if (ServerConfig.getLocalName() != null) {
			eventBusName += "_" + ServerConfig.getLocalName();
		}
		return eventBusName;
	}
}
